<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Crypto</title>
<script src="crypto2.js"></script>

<script>
	Crypto.setRSAPublicKey("96882218394188644412948371128950497316988669042955310483312233871346521989162781335950366253239556038017595089945150559663347298675294176810061756014319964351910198854019287916523068982603608268314539028314743622240324564105254079904445484175331539491289199358370665301164518143393139101791868727267883813561");
	var key128 = "27175478a590605850018a5ab73c7edc";
	var cipher  = Crypto.generateCipher();
	function cmdEncryptClick() {
		client_ciphertext.value = encodeURIComponent(cipher.encrypt(encodeURIComponent(client_plaintext.value)));
	}

	function cmdVerifyClick() {
		server_plaintext.value = decodeURIComponent(cipher.decrypt(server_ciphertext.value));
	}
</script>
</head>
<body>
	Client_Plaintext:
	<textarea id="client_plaintext" rows="3" style="width: 100%;">Type your plaintext here. Then click "Encrypt" to encrypt it.</textarea>
	<div align="right">
		<input type="button" value="Encrypt" name="cmdEncrypt" onclick="cmdEncryptClick()">
	</div>
	Client_Ciphertext:
	<textarea id="client_ciphertext" rows="3" style="width: 100%;"></textarea>
	Server_Ciphertext:
	<textarea id="server_ciphertext" rows="3" style="width: 100%;"></textarea>
	<div align="right">
		<input type="button" value="Verify" name="cmdVerify" onclick="cmdVerifyClick()">
	</div>
	Server_Plaintext:
	<textarea id="server_plaintext" rows="3" style="width: 100%;"></textarea>
</body>
</html>
